package org.restorator.dao.tx;

import org.restorator.exception.DataStoreException;

import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.Properties;

/**
 * Factory for {@link DataSource} data source implementations.
 */
public interface DataSourceFactory {

    /**
     * Properties file with connection pool configurations
     */
    public static final String PROP_FILE_NAME = "rdbc.properties";
    /**
     * Get data source {@DataSource}.
     *
     * @return {@DataSource} instance
     */
    DataSource getDataSource() throws DataStoreException;

    /**
     * Return {@Properties} properties for data source configuration.
     *
     * @return {@Properties} properties
     */
    Properties getDataSourceProperties();

    /**
     * Close DataSource instance
     * @throws SQLException
     */
    void close() throws SQLException;

}
